package com.hpeng.sys.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class SysTemplateAuthPK implements Serializable {
	private static final long serialVersionUID = 1L;
	private String templateCode;
	private String funcCode;

	public SysTemplateAuthPK() {
	}

	public SysTemplateAuthPK(String templateCode, String funcCode) {
		this.templateCode = templateCode;
		this.funcCode = funcCode;
	}

	@Column(name = "TEMPLATE_CODE")
	public String getTemplateCode() {
		return templateCode;
	}

	public void setTemplateCode(String templateCode) {
		this.templateCode = templateCode;
	}

	@Column(name = "FUNC_CODE")
	public String getFuncCode() {
		return funcCode;
	}

	public void setFuncCode(String funcCode) {
		this.funcCode = funcCode;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((funcCode == null) ? 0 : funcCode.hashCode());
		result = prime * result
				+ ((templateCode == null) ? 0 : templateCode.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysTemplateAuthPK other = (SysTemplateAuthPK) obj;
		if (funcCode == null) {
			if (other.funcCode != null)
				return false;
		} else if (!funcCode.equals(other.funcCode))
			return false;
		if (templateCode == null) {
			if (other.templateCode != null)
				return false;
		} else if (!templateCode.equals(other.templateCode))
			return false;
		return true;
	}

}